#include "wm_hal.h"
#include "nrf24l01.h"
 
void HAL_MspInit(void)
{
 
}

void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
{
    __HAL_RCC_SPI_CLK_ENABLE();
    __HAL_AFIO_REMAP_SPI_CS(NRF24L01_CS_PORT, NRF24L01_CS_PIN);
    __HAL_AFIO_REMAP_SPI_CLK(NRF24L01_SCK_PORT, NRF24L01_SCK_PIN);
    __HAL_AFIO_REMAP_SPI_MOSI(NRF24L01_MOSI_PORT, NRF24L01_MOSI_PIN);
    __HAL_AFIO_REMAP_SPI_MISO(NRF24L01_MISO_PORT, NRF24L01_MISO_PIN);
}

void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
{
    __HAL_RCC_SPI_CLK_DISABLE();
    HAL_GPIO_DeInit(NRF24L01_CS_PORT, NRF24L01_CS_PIN);
    HAL_GPIO_DeInit(NRF24L01_SCK_PORT, NRF24L01_SCK_PIN);
    HAL_GPIO_DeInit(NRF24L01_MOSI_PORT, NRF24L01_MOSI_PIN);
    HAL_GPIO_DeInit(NRF24L01_MISO_PORT, NRF24L01_MISO_PIN);
}